package com.hq.sys.controller;

import com.hq.sys.eneity.LogInfoVo;
import com.hq.sys.service.LogInfoService;
import com.hq.sys.util.ResultObj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsPackage: com.hq.sys.controller
 * @Author: jiangjunjie
 * @CreateTime: 2024-12-23  16:42
 * @Description: TODO
 * @Version: 1.8
 */
@RestController
@RequestMapping("logInfo")
public class LogInfoController {
    @Autowired
    private LogInfoService logInfoService;
    @RequestMapping("loadAllLogInfo")
    public Object loadAllLogInfo(LogInfoVo logInfoVo){
        return logInfoService.queryAllLogInfo(logInfoVo);
    }
    // 删除日志
    @RequestMapping("deleteLogInfo")
    public Object deleteLogInfo(Integer id){
      try {
          this.logInfoService.deleteLogInfo(id);
          return ResultObj.DELETE_SUCCESS;
      }catch (Exception e) {
          return ResultObj.DELETE_ERROR;
      }
    }
    // 批量删除日志
    @RequestMapping("deleteBatchLogInfo")
    public Object deleteBatchLogInfo(Integer[] ids){
        try {
            this.logInfoService.deleteBatchLogInfo(ids);
            return ResultObj.DELETE_SUCCESS;
        }catch(Exception e){
            return ResultObj.DELETE_ERROR;
        }
    }
}
